﻿
@using WebApp.Models 


@model CodeItem





    @Html.Hidden("Id",-1)
    @*@Html.HiddenFor(model => model.Id)*@ 
        <div class="form-group">
            @Html.LabelFor(model => model.Code,   htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Code, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Code,"" , new { @class = "text-danger" })
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.Text,   htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Text, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Text,"" , new { @class = "text-danger" })
            </div>
        </div>
      @*--ForeignKey BaseCodeId RelatedMasterModel  ---*@
      @Html.HiddenFor(model => model.BaseCodeId)
      @*<div class="form-group">
            @Html.LabelFor(model => model.BaseCodeId,  htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("BaseCodeId", null, htmlAttributes: new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.BaseCodeId,"" , new { @class = "text-danger" })
            </div>
        </div>*@
       @*--End ForeignKey BaseCodeId RelatedMasterModel  ---*@


 <script type="text/javascript">
    $(function () {
        var $code = $('#@Html.IdFor(model=>model.Code)');
        var $text = $('#@Html.IdFor(model=>model.Text)');
         $code.on('change', function () {
             $text.val($code.val());
         })
         
     })
</script>



